<template>
  <footer class="footer">
    <span class="todo-count">总计：<strong>{{list.length}}</strong></span>
    <ul class="filters" @click="chanege">
      <li>
        <a :class="{selected : isSet === 'all'}" href="javascript:;"  @click="isSet = 'all'">全部</a>
      </li>
      <li>
        <a :class="{selected : isSet === 'on'}" href="javascript:;" @click="isSet = 'on'">未完成</a>
      </li>
      <li>
        <a :class="{selected : isSet === 'yes'}" href="javascript:;" @click="isSet = 'yes'">已完成</a>
      </li>
    </ul> 
    <button class="clear-completed" @click="eliminate">清除已完成</button>
  </footer>
</template>

<script>
export default {
  data() {
    return {
      isSet:'all'
    }
  },
  props:['list'],
  methods: {
    eliminate(){
      this.$emit('del')
    },
    chanege(){
      // console.log(this.isSet)
      this.$emit('changeSel',this.isSet)

    }
  },
}
</script>